<#assign ctx=request.contextPath />
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>修改权限</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}/static/layuiadmin/layui/css/select.css"/>
</head>
<body>


<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>修改权限</legend>
</fieldset>

<form id="updateUserRole" class="layui-form" lay-filter="updateUserRole" action="" name="updateUserRole">

    <input type="hidden" id="id" name="id" value="">
    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">

        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text" id="nickname" name="nickname" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机号码</label>
            <div class="layui-input-inline">
                <input type="text" id="phone" name="phone" lay-verify="required|phone" placeholder="请输入手机号码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <!--<div class="layui-form-item">-->
            <!--<label class="layui-form-label">登录账号</label>-->
            <!--<div class="layui-input-inline">-->
                <!--<input type="text" id="bgLoginName" name="bgLoginName" lay-verify="required" placeholder="请输入登录账号" autocomplete="off" class="layui-input">-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="layui-form-item">-->
            <!--<label class="layui-form-label">密码</label>-->
            <!--<div class="layui-input-inline">-->
                <!--<input type="text" id="bgPassword" name="bgPassword" lay-verify="required" placeholder="请输入登录密码" autocomplete="off" class="layui-input">-->
            <!--</div>-->
        <!--</div>-->
        <div class="layui-form-item">
            <label class="layui-form-label">用户权限</label>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <select id="role" name="role" lay-verify="" id="role" lay-verify="required" class="layui-input" >

                        <#if (shiro.hasRole("2"))== true >
                        <option value="2">高级管理员</option>
                        <option value="1">普通管理员</option>
                        </#if>
                        <#if (shiro.hasRole("1"))== true >
                            <option value="1">普通管理员</option>
                        </#if>
                        <#if (shiro.hasRole("3"))== true >
                            <option value="3">网站管理员</option>
                        </#if>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
        </div>
    </div>






    <div class="layui-form-item layui-hide">
        <div class="layui-input-block">
            <button id="demo1" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
        </div>
    </div>
</form>
<script src="${ctx}/static/layuiadmin/layui/layui.js"></script>
<script src="${ctx}/static/layuiadmin/layui/select.js"></script>
<script type="text/javascript" src="${ctx}/static/jquery/jquery.min.js"></script>
<script>
  //  var formSelects = layui.formSelects
    var ctx = "${ctx}"
    layui.config({
        base: ctx + '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
        ,'formSelects': 'select'
    }).use(['index', 'form', 'upload'], function(){
        var $ = layui.$
            ,form = layui.form,
        formSelects = layui.formSelects
            ,upload = layui.upload ;

//        layer.ready(function(){
//            $.ajax({
//                //几个参数需要注意一下
//                type: "get",//方法类型
//                dataType: "json",//预期服务器返回的数据类型
//                // contentType : 'application/json; charset=UTF-8',
//                url: ctx +"/school/findAllByDeleted" ,//url
//                // async : false,
//                data: {
//                    deleted:1
//                },
//                success: function (result) {
//                    // console.log(result);//打印服务端返回的数据(调试用)
//                    if (result.code == 1) {
//                        for (var i=0;i<result.reObj.length;i++){
//                            $('#schoolIdList').append(new Option(result.reObj[i].name,result.reObj[i].id));// 下拉菜单里添加元素
//
//                        }
//                        // formSelects.value('schoolIdList',"1,2".split(","))
//                        formSelects.render();
//                    }
//                },
//                error : function(e) {
//                    layer.msg('出错了');
//                }
//            });
//
//            setTimeout(function f(){
//                $.ajax({
//                    //几个参数需要注意一下
//                    type: "get",//方法类型
//                    dataType: "json",//预期服务器返回的数据类型
//                    // contentType : 'application/json; charset=UTF-8',
//                    url: ctx +"/manageSchool/listManageSchool" ,//url
//                    // async : false,
//                    data: {
//                        userId:document.getElementById('userId').value
//                    },
//                    success: function (result) {
//                        // console.log(result);//打印服务端返回的数据(调试用)
//                        if (result.code == 1) {
//                            // formSelects.value('schoolIdList',"1,2".split(","))
//                            var data=result.reObj;
//                            var arr=[];
//                            for (var i in data ) {
//                                arr.push(data[i].schoolId);
//                            }
//                            formSelects.value('schoolIdList', arr);
//                        }
//                    },
//                    error : function(e) {
//                        layer.msg('出错了');
//                    }
//                });
//            },100
//
//        )
//
//
//        })

        //监听提交
        // $(document).ready(function() {
            // select下拉框选中触发事件
//            form.on('select(role)', function(data){
//                // alert(data.value); // 获取选中的值
//                if (data.value=="3") {
//                    $("#select").show();
//            }
//            });

        // });


    })

</script>
<script type="text/javascript">

    function getData(){
        var data=$("#updateUserRole").serialize();
        return data;
    }
</script>
</body>
</html>